home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 1.toast / pc / sample code / files / morefiles / pascalinterfaces / iteratedirectory.p < prev    next >
Encoding:
Text File  |  2000-06-23  |  1.7 KB  |  61 lines

  1. UNIT IterateDirectory;
  2.  
  3. {    IterateDirectory: File Manager directory iterator routines.                }
  4. {                                                                            }
  5. {    by Jim Luther                                                            }
  6. {                                                                            }
  7. {    File:        IterateDirectory.p                                            }
  8. {                                                                            }
  9. {    Copyright © 1996-1999 Jim Luther and Apple Computer, Inc.                }
  10. {    All rights reserved.                                                    }
  11. {                                                                            }
  12. {    You may incorporate this sample code into your applications without        }
  13. {    restriction, though the sample code has been provided "AS IS" and the    }
  14. {    responsibility for its operation is 100% yours.                            }
  15. {                                                                            }
  16. {    IterateDirectory is designed to drop into the MoreFiles sample code        }
  17. {    library I wrote while in Apple Developer Technical Support                }
  18.  
  19.  
  20. INTERFACE
  21.  
  22.     USES
  23.         Types, Files;
  24.  
  25. {***************************************************************************}
  26.  
  27.  
  28.     TYPE
  29.         IterateFilterProcPtr = ProcPtr;
  30. {    A IterateDirectory IterateFilterProc procedure should have the            }
  31. {    following form where the CInfoPBRec should be considered a CONST        }
  32. {    (do not change it):                                                        }
  33. {                                                                            }
  34. {    PROCEDURE MyIterateFilterProcPtr (VAR cpbPtr: CInfoPBRec;                }
  35. {                                      VAR quitFlag: Boolean;                }
  36. {                                      yourDataPtr: Ptr);                    }
  37.  
  38.  
  39. {***************************************************************************}
  40.  
  41.  
  42.     FUNCTION IterateDirectory (vRefNum: Integer;
  43.                                     dirID: LongInt;
  44.                                     name: StringPtr;
  45.                                     maxLevels: Integer;
  46.                                     iterateFilter: IterateFilterProcPtr;
  47.                                     yourDataPtr: Ptr): OSErr;
  48.  
  49.     FUNCTION FSpIterateDirectory ({CONST}
  50.                                     VAR spec: FSSpec;
  51.                                     maxLevels: Integer;
  52.                                     iterateFilter: IterateFilterProcPtr;
  53.                                     yourDataPtr: Ptr): OSErr;
  54.  
  55.  
  56. {***************************************************************************}
  57.  
  58.  
  59. IMPLEMENTATION
  60.  
  61. END.